<template>
  <div id="app">
    <h1>{{ msg }}</h1>
    <br/>
    <input type='text' v-model="text" />
    <button @click="test">测试</button>
  </div>
  <News :newslist="newslist"></News>
</template>

<script>
  import News from './components/News.vue'
  export default {
    data() {
      return {
        // note: changing this line won't causes changes
        // with hot-reload because the reloaded component
        // preserves its current state and we are modifying
        // its initial state.
        msg: 'Hello Json!!',
        text: 'e',
        newslist: [{ name: 'news1', time: '2017-01-02 12:11:11' }, { name: 'news2', time: '2017-01-02 12:11:14' }]
      }
    },
    components: {
      News
    },
    methods: {
      test() {
        alert('e')
      }
    }
  }
</script>

<style>
body {
  font-family: Helvetica, sans-serif;
}
</style>